<?php
$option_data = array();
foreach ($category_options as $option) {
    $option_data[$option['id']] = $option['name'];
}
?>
<?php echo isset($errors) ? $errors : ''; ?>
<?php echo form_open(base_url() . 'admin/categories/edit/' . $category->id); ?>
<table width="100%">
    <tr>
        <td width="30%"><?php echo __('name') ?> : </td>
        <td><input type="text" size="50" name="cat_name" value="<?php echo $category->category; ?>" /></td>
    </tr>
    <?php if ($category->id > 2): ?>
        <tr>
            <td width="30%"><?php echo __('parent_cat') ?> : </td>
            <td>
                <?php echo form_dropdown('cat_id', $option_data, isset($_POST['cat_id']) ? $_POST['cat_id'] : $category->parent_id, 'id="cat_id"'); ?>
            </td>
        </tr>
    <?php endif; ?>
    <tr>
        <td></td>
        <td><?php echo form_submit('btnSubmit', 'Save'); ?></td>
    </tr>
</table>
<?php echo form_close(); ?>